<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>行运盘 | 星象运势分析</title>
    <style>
        /* 基础样式重置 */
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            /* 禁用移动端点击蒙层效果 */
            -webkit-tap-highlight-color: transparent;
            tap-highlight-color: transparent;
            outline: none;
        }

        /* 为可点击元素添加特定样式 */
        button,
        [class$="-btn"],
        .zodiac-sign,
        .transit-center,
        .planet,
        .house,
        .transit-planet,
        a,
        [role="button"] {
            /* 禁用移动端点击蒙层效果 */
            -webkit-tap-highlight-color: transparent;
            tap-highlight-color: transparent;
            /* 防止文本选择 */
            -webkit-user-select: none;
            -moz-user-select: none;
            -ms-user-select: none;
            user-select: none;
            outline: none;
        }

        body {
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            background: #0a0e17;
            color: #ffffff;
            min-height: 100vh;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            padding: 0;
            overflow-x: hidden;
            overflow-y: auto; /* 允许垂直滚动 */
        }
        
        /* 在iframe中显示时特殊处理 */
        body.in-iframe {
            padding: 20px;
        }

        /* 隐藏所有元素的滚动条但允许滚动 */
        html {
            scrollbar-width: none; /* Firefox */
            -ms-overflow-style: none; /* IE and Edge */
        }

        body {
            scrollbar-width: none; /* Firefox */
            -ms-overflow-style: none; /* IE and Edge */
        }

        /* Chrome, Safari and Opera */
        html::-webkit-scrollbar,
        body::-webkit-scrollbar {
            display: none;
        }

        /* 确保所有可滚动元素也隐藏滚动条 */
        * {
            scrollbar-width: none; /* Firefox */
        }

        *::-webkit-scrollbar {
            display: none; /* Chrome, Safari, Edge */
        }

        /* 页面标题 */
        header {
            text-align: center;
            margin-bottom: 30px;
            z-index: 10;
        }

        h1 {
            font-size: 2.5rem;
            margin-bottom: 10px;
            background: linear-gradient(90deg, #ff6b6b, #feca57, #48dbfb, #1dd1a1, #c8d6e5);
            -webkit-background-clip: text;
            background-clip: text;
            color: transparent;
            background-size: 300% 300%;
            animation: gradient 15s ease infinite;
        }

        @keyframes gradient {
            0% { background-position: 0% 50%; }
            50% { background-position: 100% 50%; }
            100% { background-position: 0% 50%; }
        }

        .subtitle {
            color: #b2bec3;
            font-size: 1.1rem;
            max-width: 600px;
        }

        /* 出生日期和时间表单 */
        .birth-info-form {
            background: rgba(17, 24, 39, 0.8);
            backdrop-filter: blur(10px);
            border-radius: 12px;
            padding: 20px;
            margin-bottom: 30px;
            width: 90%;
            max-width: 600px;
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
            border: 1px solid rgba(255, 255, 255, 0.1);
        }

        .form-row {
            display: flex;
            flex-wrap: wrap;
            gap: 15px;
            margin-bottom: 15px;
        }

        .form-group {
            flex: 1;
            min-width: 200px;
        }

        .form-group label {
            display: block;
            margin-bottom: 5px;
            color: #b2bec3;
            font-size: 0.9rem;
        }

        .form-group input {
            width: 100%;
            padding: 10px;
            border: 1px solid rgba(255, 255, 255, 0.1);
            border-radius: 8px;
            background: rgba(30, 41, 59, 0.8);
            color: white;
            font-size: 1rem;
        }

        .form-group input:focus {
            outline: 2px solid rgba(59, 130, 246, 0.8);
            outline-offset: 2px;
        }

        .calculate-btn {
            width: 100%;
            padding: 12px;
            background: linear-gradient(90deg, #54a0ff, #00d2d3);
            border: none;
            border-radius: 8px;
            color: white;
            font-size: 1.1rem;
            font-weight: bold;
            cursor: pointer;
            transition: all 0.3s ease;
        }

        .calculate-btn:hover {
            transform: translateY(-2px);
            box-shadow: 0 5px 15px rgba(59, 130, 246, 0.5);
        }

        /* 行运盘容器 */
        .transit-container {
            position: relative;
            width: 90vw;
            max-width: 800px;
            height: 90vw;
            max-height: 800px;
            margin: 20px auto;
        }

        /* 当在iframe中加载时增加宽度限制 */
        body.in-iframe .transit-container {
            max-width: 1100px;
            max-height: 1100px;
        }

        /* 行运盘底座 */
        .transit-base {
            position: absolute;
            width: 100%;
            height: 100%;
            border-radius: 50%;
            background: radial-gradient(circle, #1a237e 0%, #0d1117 100%);
            box-shadow: 0 0 50px rgba(33, 150, 243, 0.3);
            overflow: hidden;
        }

        /* 宫位环 */
        .houses-ring {
            position: absolute;
            width: 90%;
            height: 90%;
            top: 5%;
            left: 5%;
            border-radius: 50%;
        }

        /* 宫位扇区 */
        .house-sector {
            position: absolute;
            width: 50%;
            height: 50%;
            top: 0;
            left: 50%;
            transform-origin: bottom left;
            border: 1px solid rgba(255, 255, 255, 0.1);
        }

        /* 本命行星环 */
        .natal-planets-ring {
            position: absolute;
            width: 80%;
            height: 80%;
            top: 10%;
            left: 10%;
            border-radius: 50%;
        }

        /* 行运行星环 */
        .transit-planets-ring {
            position: absolute;
            width: 70%;
            height: 70%;
            top: 15%;
            left: 15%;
            border-radius: 50%;
        }

        /* 行星样式 */
        .natal-planet,
        .transit-planet {
            position: absolute;
            width: 30px;
            height: 30px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            transform: translate(-50%, -50%);
            cursor: pointer;
            transition: all 0.3s ease;
        }

        .natal-planet {
            background: linear-gradient(135deg, #54a0ff, #00d2d3);
            box-shadow: 0 0 10px rgba(84, 160, 255, 0.7);
        }

        .transit-planet {
            background: linear-gradient(135deg, #ff6b6b, #feca57);
            box-shadow: 0 0 10px rgba(255, 107, 107, 0.7);
        }

        .natal-planet:hover,
        .transit-planet:hover {
            transform: translate(-50%, -50%) scale(1.2);
        }

        .planet-symbol {
            font-size: 1.2rem;
            color: white;
        }

        /* 行运信息面板 */
        .transit-info-panel {
            background: rgba(17, 24, 39, 0.8);
            backdrop-filter: blur(10px);
            border-radius: 12px;
            padding: 20px;
            margin-top: 30px;
            width: 90%;
            max-width: 600px;
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
            border: 1px solid rgba(255, 255, 255, 0.1);
        }

        .transit-info-title {
            font-size: 1.2rem;
            font-weight: bold;
            margin-bottom: 15px;
            color: #48dbfb;
        }

        .transit-aspect {
            padding: 10px;
            margin-bottom: 10px;
            border-radius: 8px;
            background: rgba(30, 41, 59, 0.5);
            border-left: 3px solid #48dbfb;
        }

        /* 响应式调整 */
        @media (max-width: 768px) {
            h1 {
                font-size: 2rem;
            }
            
            .subtitle {
                font-size: 1rem;
            }
            
            .natal-planet,
            .transit-planet {
                width: 25px;
                height: 25px;
            }
            
            .planet-symbol {
                font-size: 1rem;
            }
        }

        @media (max-width: 480px) {
            h1 {
                font-size: 1.8rem;
            }
            
            .natal-planet,
            .transit-planet {
                width: 20px;
                height: 20px;
            }
            
            .planet-symbol {
                font-size: 0.8rem;
            }
        }
    </style>
</head>
<body>
    <header>
        <h1>行运盘</h1>
        <p class="subtitle">分析当前行星运行对您的影响</p>
    </header>

    <!-- 出生日期和时间表单 -->
    <div class="birth-info-form">
        <div class="form-row">
            <div class="form-group">
                <label for="birth-date">出生日期</label>
                <input type="date" id="birth-date" placeholder="选择出生日期">
            </div>
            <div class="form-group">
                <label for="birth-time">出生时间</label>
                <input type="time" id="birth-time" placeholder="选择出生时间">
            </div>
        </div>
        <button class="calculate-btn" onclick="generateTransitChart()">计算行运盘</button>
    </div>

    <!-- 行运盘容器 -->
    <div class="transit-container">
        <div class="transit-base"></div>
        <div class="houses-ring" id="houses-ring"></div>
        <div class="natal-planets-ring" id="natal-planets-ring"></div>
        <div class="transit-planets-ring" id="transit-planets-ring"></div>
    </div>

    <!-- 行运信息面板 -->
    <div class="transit-info-panel" id="transit-info-panel">
        <h3 class="transit-info-title">当前行运影响</h3>
        <div id="transit-aspects">
            <p style="color: #b2bec3;">请输入您的出生日期和时间，计算当前行星运行对您的影响。</p>
        </div>
    </div>

    <script>
        // 行星数据
        const planets = [
            { name: '太阳', symbol: '☉', color: '#feca57' },
            { name: '月亮', symbol: '☽', color: '#c8d6e5' },
            { name: '水星', symbol: '☿', color: '#a2aab8' },
            { name: '金星', symbol: '♀', color: '#ff9ff3' },
            { name: '火星', symbol: '♂', color: '#ff6b6b' },
            { name: '木星', symbol: '♃', color: '#10ac84' },
            { name: '土星', symbol: '♄', color: '#718096' },
            { name: '天王星', symbol: '♅', color: '#00d2d3' },
            { name: '海王星', symbol: '♆', color: '#54a0ff' },
            { name: '冥王星', symbol: '♇', color: '#5f27cd' }
        ];

        // 宫位数据
        const houses = [
            { number: 1, name: '第一宫', meaning: '自我、身份、外表' },
            { number: 2, name: '第二宫', meaning: '财富、价值观、物质' },
            { number: 3, name: '第三宫', meaning: '沟通、学习、短途旅行' },
            { number: 4, name: '第四宫', meaning: '家庭、根源、安全感' },
            { number: 5, name: '第五宫', meaning: '创造力、爱情、娱乐' },
            { number: 6, name: '第六宫', meaning: '工作、健康、日常习惯' },
            { number: 7, name: '第七宫', meaning: '关系、合作、伴侣' },
            { number: 8, name: '第八宫', meaning: '转变、共享资源、神秘' },
            { number: 9, name: '第九宫', meaning: '哲学、长途旅行、高等教育' },
            { number: 10, name: '第十宫', meaning: '事业、声誉、社会地位' },
            { number: 11, name: '第十一宫', meaning: '朋友、团体、理想' },
            { number: 12, name: '第十二宫', meaning: '潜意识、秘密、精神' }
        ];

        // 计算行运盘
        function generateTransitChart() {
            const birthDate = document.getElementById('birth-date').value;
            const birthTime = document.getElementById('birth-time').value;

            if (!birthDate || !birthTime) {
                alert('请输入您的出生日期和时间');
                return;
            }

            // 清空现有内容
            document.getElementById('houses-ring').innerHTML = '';
            document.getElementById('natal-planets-ring').innerHTML = '';
            document.getElementById('transit-planets-ring').innerHTML = '';
            document.getElementById('transit-aspects').innerHTML = '';

            // 随机生成宫位（实际应用中应该使用真实的星盘计算）
            createHouses();
            
            // 随机生成本命行星位置
            createNatalPlanets();
            
            // 随机生成行运行星位置
            createTransitPlanets();
            
            // 生成行运相位信息
            generateTransitAspects();
        }

        // 创建宫位
        function createHouses() {
            const housesRing = document.getElementById('houses-ring');
            const angleStep = 360 / 12;

            houses.forEach((house, index) => {
                const houseSector = document.createElement('div');
                houseSector.classList.add('house-sector');
                houseSector.style.transform = `rotate(${index * angleStep}deg)`;
                
                // 创建宫位标签
                const houseLabel = document.createElement('div');
                houseLabel.style.position = 'absolute';
                houseLabel.style.bottom = '10px';
                houseLabel.style.right = '10px';
                houseLabel.style.transform = 'rotate(-' + (index * angleStep) + 'deg)';
                houseLabel.style.fontSize = '0.9rem';
                houseLabel.style.color = 'rgba(255, 255, 255, 0.7)';
                houseLabel.textContent = house.number;
                
                houseSector.appendChild(houseLabel);
                housesRing.appendChild(houseSector);
            });
        }

        // 创建本命行星
        function createNatalPlanets() {
            const natalPlanetsRing = document.getElementById('natal-planets-ring');
            const radius = natalPlanetsRing.offsetWidth / 2;
            
            planets.forEach(planet => {
                const angle = Math.random() * 360; // 随机角度
                const radians = angle * Math.PI / 180;
                
                // 计算位置
                const x = radius + radius * Math.cos(radians);
                const y = radius + radius * Math.sin(radians);
                
                // 创建行星元素
                const planetElement = document.createElement('div');
                planetElement.classList.add('natal-planet');
                planetElement.style.left = `${x}px`;
                planetElement.style.top = `${y}px`;
                planetElement.title = `${planet.name} (本命)`;
                
                // 添加行星符号
                const symbolElement = document.createElement('span');
                symbolElement.classList.add('planet-symbol');
                symbolElement.textContent = planet.symbol;
                
                planetElement.appendChild(symbolElement);
                natalPlanetsRing.appendChild(planetElement);
            });
        }

        // 创建行运行星
        function createTransitPlanets() {
            const transitPlanetsRing = document.getElementById('transit-planets-ring');
            const radius = transitPlanetsRing.offsetWidth / 2;
            
            planets.forEach(planet => {
                const angle = Math.random() * 360; // 随机角度
                const radians = angle * Math.PI / 180;
                
                // 计算位置
                const x = radius + radius * Math.cos(radians);
                const y = radius + radius * Math.sin(radians);
                
                // 创建行星元素
                const planetElement = document.createElement('div');
                planetElement.classList.add('transit-planet');
                planetElement.style.left = `${x}px`;
                planetElement.style.top = `${y}px`;
                planetElement.title = `${planet.name} (行运)`;
                
                // 添加行星符号
                const symbolElement = document.createElement('span');
                symbolElement.classList.add('planet-symbol');
                symbolElement.textContent = planet.symbol;
                
                planetElement.appendChild(symbolElement);
                transitPlanetsRing.appendChild(planetElement);
            });
        }

        // 生成行运相位信息
        function generateTransitAspects() {
            const transitAspectsContainer = document.getElementById('transit-aspects');
            const aspects = [
                { type: '合相', description: '太阳与土星合相，增强责任感和组织能力', intensity: '强' },
                { type: '对分相', description: '月亮与火星对分相，情绪与行动之间的张力需要注意', intensity: '中' },
                { type: '三分相', description: '水星与木星三分相，有利于沟通和学习新事物', intensity: '强' },
                { type: '四分相', description: '金星与天王星四分相，关系中可能出现意外变化', intensity: '中' },
                { type: '六分相', description: '火星与海王星六分相，创意和行动能力得到支持', intensity: '弱' }
            ];

            aspects.forEach(aspect => {
                const aspectElement = document.createElement('div');
                aspectElement.classList.add('transit-aspect');
                aspectElement.innerHTML = `
                    <strong style="color: #48dbfb;">${aspect.type}</strong> (强度: ${aspect.intensity})<br>
                    <span style="color: #b2bec3;">${aspect.description}</span>
                `;
                transitAspectsContainer.appendChild(aspectElement);
            });
        }

        // 自动设置今天的日期作为默认值
        function setDefaultDate() {
            const today = new Date();
            const year = today.getFullYear();
            const month = String(today.getMonth() + 1).padStart(2, '0');
            const day = String(today.getDate()).padStart(2, '0');
            document.getElementById('birth-date').value = `${year}-${month}-${day}`;
            document.getElementById('birth-time').value = '12:00';
        }

        // 页面加载完成后初始化
        window.addEventListener('load', () => {
            setDefaultDate();
        });
    </script>
</body>
</html>